package com.drcoffee.drcoffeemall.mapper;

import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;
import org.springframework.stereotype.Repository;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.Map;

@Mapper
@Repository
public interface InvoiceMapper {
    List<Map<String, Object>>  getInvoiceData(Map<String,Object> paramMap);

    @Update("UPDATE invoice_records SET file_path = #{file_path},Invoice_date = NOW(),current_step = 2 WHERE code = #{code}")
    void setInvoicePath(String code, String file_path);

    @Update("UPDATE  invoice_records SET current_step= 2 WHERE order_code=#{order_code}")
    Integer updateCurrentStep(String orderCode);

    @Select("select current_step from  invoice_records where  order_code=#{order_code}")
    Integer num(String orderCode);
}
